<template>
  <header-nav-bar></header-nav-bar>

  <div style="width: 100%;height: 200px;position: absolute;top:100px;">
    <van-cell title="管理员设置" is-link/>
    <van-cell title="扫码" is-link/>
  </div>
  <van-button type="primary" block class="logout" @click="doLogout">登出</van-button>
  <bottom-tabbar :index="2"></bottom-tabbar>
</template>

<script setup lang="ts">
const headerNavBar = defineAsyncComponent(() =>
    import('@/components/HeaderNavBar.vue')
)
const bottomTabbar = defineAsyncComponent(() =>
    import('@/components/bottomTabbar.vue')
)

import {defineAsyncComponent, ref} from "vue";
import {useRouter} from 'vue-router'
import tools from '@/utils/tools.js'
import {Toast} from "vant";
import {logout} from '@/service/login.js'

let router = useRouter()

const doLogout = () => {
  logout()
  tools.removeUser()
  Toast.success("当前账号已登出")
  // router.push("/login")
}

</script>

<style scoped>
.logout {
  position: absolute;
  bottom: 50px;
}
</style>